Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: get job run from Optimus DB #278

Open
wants to merge 1 commit into
base: release-v0.16
Choose a base branch
from

Conversation

Mryashbhardwaj
Copy link
Member

No description provided.

// JobRun currently gets the job runs from scheduler based on the criteria
// TODO: later should collect the job runs from optimus
// GetJobRun gets job runs from optimus DB based on the criteria
func (h JobRunHandler) GetJobRun(ctx context.Context, req *pb.GetJobRunsRequest) (*pb.GetJobRunsResponse, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we provide test for this handler?

@@ -146,6 +149,27 @@ func (s *JobRunService) JobRunInput(ctx context.Context, projectName tenant.Proj
return s.compiler.Compile(ctx, details, config, executedAt)
}

func (s *JobRunService) GetJobRunsByFilter(ctx context.Context, projectName tenant.ProjectName, jobName scheduler.JobName, filters ...filter.FilterOpt) ([]*scheduler.JobRun, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add test for this function as well

@@ -90,6 +91,56 @@ func (j *JobRunRepository) GetByID(ctx context.Context, id scheduler.JobRunID) (
return jr.toJobRun()
}

func (j *JobRunRepository) GetLatestRun(ctx context.Context, project tenant.ProjectName, jobName scheduler.JobName, runState *scheduler.State) (*scheduler.JobRun, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also provide test GetLatestRun and GetRunsByTimeRange

@deryrahman
Copy link
Member

can you update proto commit reference in Makefile? I believe this should be changed according to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants